package com.boco.ibssystem.common.base;

import com.alibaba.dubbo.config.annotation.Reference;
import com.boco.sp.external.service.IDicCommonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: 基础的service
 * @Author: xujp
 * @CreateDate: 2019/4/4$ 11:47$
 * @UpdateUser: yc
 * @UpdateDate: 2019/4/4$ 11:47$
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Component
public class AbstractService {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    @Reference
    protected IDicCommonService dicCommonService;

    /**
     * 通过需要解密字段对应的类别ID以及需要解密的值来解密
     * @param dicType 解密类型的ID
     * @param code 解密的值
     * @return
     */
    public String decryptCode(String dicType,String code){
        return  dicCommonService.getNameByDicTypeAndcode(dicType,code);
    }
}
